package com.aspose.cells;

import java.util.ArrayList;

class zauu {
   static boolean a(ArrayList var0, Cell var1, int[] var2) {
      switch(var1.getType()) {
      case 0:
         com.aspose.cells.b.a.a.ze.a(var0, (Object)(var1.getBoolValue() ? 1.0D : 0.0D));
         ++var2[0];
         break;
      case 1:
      case 4:
         com.aspose.cells.b.a.a.ze.a(var0, (Object)var1.getDoubleValue());
         ++var2[0];
         break;
      case 2:
         return false;
      case 3:
      default:
         break;
      case 5:
         ++var2[0];
      }

      return true;
   }

   static ArrayList a(ArrayList var0, boolean var1, PivotField var2, boolean[] var3, int var4, zauk var5, int var6, zbrd var7, int[] var8, boolean[] var9) {
      var8[0] = 0;
      var9[0] = false;
      int var10 = var2.getBaseIndex();
      ArrayList var11 = new ArrayList();
      if (var10 >= 0 && var10 < var3.length) {
         if (var3[var10]) {
            zbqs var18 = (zbqs)var5.p.get(var10);
            ArrayList var19 = var18.c;
            if (var19 == null || var19.size() == 0) {
               var8[0] = 0;
               return var11;
            }

            for(int var20 = 0; var20 < var0.size(); ++var20) {
               zea var15 = (zea)var0.get(var20);
               if ((!var1 || !var15.b) && var15.a[var10] != null) {
                  int var16 = (Integer)var15.a[var10];
                  if (var16 < var19.size()) {
                     Object var17 = ((zbmb)var19.get(var16)).a;
                     if (var17 != null) {
                        switch(var4) {
                        case 1:
                           ++var8[0];
                           break;
                        case 6:
                           if (var17 instanceof Integer || var17 instanceof Double) {
                              ++var8[0];
                           }
                           break;
                        default:
                           if (var17 instanceof Integer) {
                              com.aspose.cells.b.a.a.ze.a(var11, (Object)((double)(Integer)var17));
                              ++var8[0];
                           } else if (var17 instanceof Long) {
                              com.aspose.cells.b.a.a.ze.a(var11, (Object)((double)(Long)var17));
                              ++var8[0];
                           } else if (var17 instanceof Double) {
                              com.aspose.cells.b.a.a.ze.a(var11, var17);
                              ++var8[0];
                           } else if (var17 instanceof DateTime) {
                              com.aspose.cells.b.a.a.ze.a(var11, (Object)CellsHelper.getDoubleFromDateTime((DateTime)var17, false));
                              ++var8[0];
                           } else {
                              var9[0] = true;
                           }
                        }
                     }
                  }
               }
            }
         } else {
            for(int var12 = 0; var12 < var0.size(); ++var12) {
               zea var13 = (zea)var0.get(var12);
               Object var14 = var13.a[var10];
               if (var14 != null) {
                  switch(var4) {
                  case 1:
                     ++var8[0];
                     break;
                  case 6:
                     if (var14 instanceof Integer || var14 instanceof Double) {
                        ++var8[0];
                     }
                     break;
                  default:
                     if (var14 instanceof Integer) {
                        com.aspose.cells.b.a.a.ze.a(var11, (Object)((double)(Integer)var14));
                        ++var8[0];
                     } else if (var14 instanceof Long) {
                        com.aspose.cells.b.a.a.ze.a(var11, (Object)((double)(Long)var14));
                        ++var8[0];
                     } else if (var14 instanceof Double) {
                        com.aspose.cells.b.a.a.ze.a(var11, var14);
                        ++var8[0];
                     } else if (var14 instanceof DateTime) {
                        com.aspose.cells.b.a.a.ze.a(var11, (Object)CellsHelper.getDoubleFromDateTime((DateTime)var14, false));
                        ++var8[0];
                     } else {
                        var9[0] = true;
                     }
                  }
               }
            }
         }

         return var11;
      } else {
         return var11;
      }
   }
}
